/* USER CODE BEGIN Header */
/**
 ******************************************************************************
 * @file           : AHT20.h
 * @brief          : Header for AHT20.c file.
 *                   This file contains the common defines of the application.
 ******************************************************************************
 * @attention
 *
 * Copyright (c) [2021] [Fudan Microelectronics]
 * THIS SOFTWARE is licensed under Mulan PSL v2.
 * can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 *
 ******************************************************************************
 */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __AHT20_H
#define __AHT20_H

#ifdef __cplusplus
extern "C"
{
#endif

  /* Includes ------------------------------------------------------------------*/

  /* Private includes ----------------------------------------------------------*/
  /* USER CODE BEGIN Includes */

#include "fm33le0xx_fl_def.h"

  /* USER CODE END Includes */

  /* Exported types ------------------------------------------------------------*/
  /* USER CODE BEGIN ET */

  typedef struct
  {
    float humidity;    /*!< humidity data*/
    float temperature; /*!< temperature data*/
  } aht20_data;

#define AHT20_DEBUG (1)

#define AHT20_ADDRRES (0x38)
#define AHT20_INIT_REG (0xBE)
#define AHT20_SOFTRESET_REG (0xBA)
#define AHT20_TRIGMEASURE_REG (0xAC)

  /* USER CODE END ET */

  /* Exported constants --------------------------------------------------------*/
  /* USER CODE BEGIN EC */

  /* USER CODE END EC */

  /* Exported macro ------------------------------------------------------------*/
  /* USER CODE BEGIN EM */

  /* USER CODE END EM */

  /* Exported functions prototypes ---------------------------------------------*/

  FL_ErrorStatus aht20_init(void);
  FL_ErrorStatus aht20_read_from_device(aht20_data *aht_param);
  /* USER CODE BEGIN EFP */

  /* USER CODE END EFP */

  /* Private defines -----------------------------------------------------------*/

  /* USER CODE BEGIN Private defines */

  /* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __AHT20_H */

/************************ (C) COPYRIGHT FMSH *****END OF FILE****/
